package com.xone.collaboration.service.impl.process;

import com.xone.collaboration.service.OperationProcess;
import com.xone.collaboration.service.impl.strategy.OpStrategyInvoker;
import com.xone.collaboration.service.vo.OperationResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Order(2)
public class LayerStoreProcess implements OperationProcess {

    @Autowired
    private OpStrategyInvoker opStrategyInvoker;

    @Override
    public OperationResult process(OperationContext context) {
        return opStrategyInvoker.invoke(context);
    }

    @Override
    public boolean needRun(OperationContext context) {
        return context.getNeedRun();
    }
}
